<?php
require 'FormFunction.php';
$form_data = ['username' => 'liuhao','password' => 123456,'repassword' => 1234561];
try{
   echo checkForm($form_data);
}catch(NameException $ne){
    $data = [
        'status' => -1,
        'message' => $ne->getMessage()
    ];
    echo json_encode($data);
}catch(PassException $pa){
    $data = [
        'status' => -1,
        'message' => $pa->getMessage()
    ];
    echo json_encode($data);
}catch(EmailException $em){
    $data = [
        'status' => -1,
        'message' => $em->getMessage()
    ];
    echo json_encode($data);
}catch(Exception $eo){
    $data = [
        'status' => -1,
        'message' => $eo->getMessage()
    ];
    echo json_encode($data);
}
